--[[
  ** 关于生成工具的声明 **
local Utility = require "packages/water_wegame/utility"

  ** 关于技能的信息 **
--]]
local skills={}
local _skill_val = fk.CreateSkill {
  name = "steam__jiangjunchoujun",
  tags = {},
}


Fk:loadTranslationTable {
  ["steam__jiangjunchoujun"] = "将军抽车",
  [":steam__jiangjunchoujun"] = "你成为伤害牌目标时，使用者可将区域内的一张牌向你移动以令伤害值+1。若为装备牌，则该牌名字与效果改为“将军抽车”。",
  ["#steam__jiangjunchoujun"] = "将军抽车：你可将区域内的一张牌向%dest移动以令伤害值+1。若为装备牌，则该牌名字与效果改为“将军抽车”。",
  ["@@jiangjunchouju_equip"] = "将军抽车",
}



_skill_val:addEffect(fk.TargetConfirmed, {--激昂
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(_skill_val.name) and target == player and data.card.is_damage_card  then
    -- 玩家有技能                      玩家成为目标          伤害牌                             
     return data.from and  table.find(data.from:getCardIds("ej"), function (id)
        return  data.from:canMoveCardInBoardTo(player, id)
      end)
    end
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    return room:askToSkillInvoke(data.from,{
      prompt="#steam__jiangjunchoujun::"..player.id,
      skill_name=_skill_val.name,
    })
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local move_data = room:askToMoveCardInBoard(data.from, {
      target_one = data.from,
      target_two =player,
      skill_name = _skill_val.name,
      move_from = data.from,
      skip=true,
    })
    if not move_data then return end
    local card=move_data.card
    data.use.additionalDamage = data.use.additionalDamage or 0 + 1
    if move_data.card.type == Card.TypeEquip then
      
      local mapper = {
        [Card.SubtypeWeapon] = "weapon",
        [Card.SubtypeArmor] = "armor",
        [Card.SubtypeOffensiveRide] = "offensive_horse",
        [Card.SubtypeDefensiveRide] = "defensive_horse",
        [Card.SubtypeTreasure] = "treasure",
      }
      room:setCardMark(card, _skill_val.name, mapper[card.sub_type])
      Fk:filterCard(card.id, player)

    end
    room:moveCardTo(
      card,
      card.type == Card.TypeEquip and Player.Equip or Player.Judge,
      player,
      fk.ReasonPut,
      _skill_val.name,
      nil,
      true,
      player
    )
  end,
})

_skill_val:addEffect("filter", {  
  card_filter = function(self, to_select, player, isJudgeEvent)
    return to_select:getMark(_skill_val.name) ~= 0
  end,
  view_as = function(self, player, to_select)
    local name = to_select:getMark(_skill_val.name).."__jiangjunchouju"
    return Fk:cloneCard(name, to_select.suit, to_select.number)
  end,
})


return _skill_val
